package com.googlecode.cannedbeans.generator.model;

import java.lang.reflect.Method;
import java.util.Map;

/**
 *
 * @author Kim
 */
public class Property {

    private String name;
    private Method setterMethod;
    private Type type;
    private Map<ConstraintType, Constraint> constraints;

    public Map<ConstraintType, Constraint> getConstraints() {
        return constraints;
    }

    public void setConstraints(Map<ConstraintType, Constraint> constraints) {
        this.constraints = constraints;
    }
    
    public void addConstraint(Constraint constraint) {
        this.constraints.put(constraint.getConstraintType(), constraint);
    }
    
    public void removeConstraint (Constraint constraint) {
        this.constraints.remove(constraint.getConstraintType());
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Method getSetterMethod() {
        return setterMethod;
    }

    public void setSetterMethod(Method setterMethod) {
        this.setterMethod = setterMethod;
    }
}
